package com.futureCloudMOM.controller.core.web.view;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.futureCloudMOM.common.core.controller.BaseController;
import com.futureCloudMOM.common.core.page.TableDataInfo;
import com.futureCloudMOM.core.view.VBasicSourceinfo;
import com.futureCloudMOM.core.service.VBasicSourceinfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("VBasicSourceinfo")
@Api(value = "v_Basic_SourceInfo", description = "源单主表--发生方/目标方视图")
public class VBasicSourceinfoController extends BaseController {

    @Autowired
    private VBasicSourceinfoService vBasicSourceinfoService;

    @GetMapping("getListByTypeId")
    public TableDataInfo getListByTypeId(VBasicSourceinfo vBasicSourceinfo){
        List<VBasicSourceinfo> list = vBasicSourceinfoService.list(new LambdaQueryWrapper<VBasicSourceinfo>()
                .eq(VBasicSourceinfo::getRoleTypeId,vBasicSourceinfo.getRoleTypeId()));
        return getDataTable(list);
    }


}
